"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
// 类装饰器：当类定义被读取时调用
function ClassDecorator(target) {
    console.log("类装饰器调用");
}
// 方法装饰器：当方法定义被读取时调用
function MethodDecorator(target, propertyKey, descriptor) {
    console.log("方法装饰器调用");
}
// 访问器装饰器：当访问器定义被读取时调用
function AccessorDecorator(target, propertyKey, descriptor) {
    console.log("访问器装饰器调用");
}
// 属性装饰器：当属性定义被读取时调用
function PropertyDecorator(target, propertyKey) {
    console.log("属性装饰器调用");
}
// 参数装饰器：当参数定义被读取时调用
function ParameterDecorator(target, propertyKey, parameterIndex) {
    console.log(`参数装饰器调用，目标参数位置: ${parameterIndex}`);
}
let MyClass = class MyClass {
    constructor(param) {
        this.property = param;
        console.log("MyClass 构造函数调用");
    }
    get accessorProperty() {
        return this.property;
    }
    method(param) {
        console.log("方法执行");
    }
};
__decorate([
    PropertyDecorator,
    __metadata("design:type", String)
], MyClass.prototype, "property", void 0);
__decorate([
    AccessorDecorator,
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [])
], MyClass.prototype, "accessorProperty", null);
__decorate([
    MethodDecorator,
    __param(0, ParameterDecorator),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], MyClass.prototype, "method", null);
MyClass = __decorate([
    ClassDecorator,
    __metadata("design:paramtypes", [String])
], MyClass);
// 实例化 MyClass
// const myClassInstance = new MyClass("测试参数");
// console.log(myClassInstance.accessorProperty);
// myClassInstance.method("测试方法参数");
